/*
 * @Author: dvlproad
 * @Date: 2023-05-11 21:32:55
 * @LastEditors: dvlproad
 * @LastEditTime: 2023-10-23 18:11:38
 * @Description: 
 */
import 'package:webview_flutter/webview_flutter.dart';

class JavascriptChannel {
  String? name;
  void Function(JavaScriptMessage)? _original;
  JavascriptChannel({
    required this.name,
    required Function(JavaScriptMessage)? onMessageReceived,
  }) {
    _original = onMessageReceived;
  }

  onMessageReceived(JavaScriptMessage message) {
    if (_original != null) {
      _original!(message);
    }
  }
}
